package com.rnkrsoft.suyan.config.server.ajax.authority;

import com.rnkrsoft.reflection4j.extension.SPI;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 权限信息提取器
 */
@SPI("mock")
public interface AuthorityExtractor {

    /**
     * 从浏览器提取权限上下文
     * @param request HTTP请求
     * @param response HTTP应答
     * @return 权限上下文
     */
    AuthorityContext extract(HttpServletRequest request, HttpServletResponse response);
}
